﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

using FarseerPhysics.Common;
using FarseerPhysics.Dynamics;
using FarseerPhysics.Factories;
using FarseerPhysics.Collision;
using FarseerPhysics.Collision.Shapes;
using FarseerPhysics.Controllers;
using FarseerPhysics.SamplesFramework;

namespace game
{
    class CPlayer
    {   
        // Zycie gracza.
        public int Healt { set; get; }

        // Stamina gracza.
        public int Stamina { set; get; }

        public CPlayer(Vector2 position, int healt, int stamina, int moveSpeed, string textureName,
            World world)
        {
            Healt = healt;
            Stamina = stamina;

            _moveSpeed = moveSpeed;
            _sprite = new CSprite(world, CContentLoader.LoadTexture(textureName), position, false);
        }

        /// <summary>
        /// Metoda update, należy ją wywołać w głównej metodzie update.
        /// </summary>
        public void Update()
        {
            if (Keyboard.GetState().IsKeyDown(Keys.Left))
            {             
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Right))
            {
            }

            if (Keyboard.GetState().IsKeyDown(Keys.Up))
            {
            }
        }

        /// <summary>
        /// Rysowanie gracza.
        /// </summary>
        /// <param name="spriteBatch"></param>
        public void Draw(SpriteBatch spriteBatch)
        {
            _sprite.Draw(spriteBatch);
        }

        private CSprite _sprite;

        // Szybkość poruszania się gracza.
        private int _moveSpeed;
    }
}
